<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div v-if="crud.props.searchToggle">
        <el-select v-model="query.dealer_id" filterable placeholder="请选择单位" style="width: 185px;" class="filter-item" clearable>
          <el-option v-for="item in dict.dealers" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-select v-model="query.interface_type" filterable placeholder="请选择接口类型" style="width: 145px;" class="filter-item" clearable>
          <el-option v-for="item in dict.eq_interface_type" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-select v-model="query.online_status" filterable placeholder="是否在线" style="width: 105px;" class="filter-item" clearable>
          <el-option v-for="item in dict.online_status" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-select v-model="query.eq_type" filterable placeholder="农机类型" style="width: 105px;" class="filter-item" clearable>
          <el-option v-for="item in dict.equipment_type" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-input v-model="query.q_code" clearable placeholder="请输入农机制造编号/发动机编号/机械环保代码" style="width: 280px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <date-range-picker v-model="query.createTime" class="date-item" startPlaceholder="定位日期"/>
        <rrOperation />
      </div>
      <crudOperation />
    </div>
    <!--表格渲染-->
    <el-table ref="table" v-loading="crud.loading"  :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<!--      <el-table-column prop="dealer_name" label="所属单位" width="200" />-->
      <el-table-column   label="农机制造编号" width="100" fixed="left">
        <template slot-scope="scope">
          <router-link :to="'detail/' + scope.row.eq_code">
            <div style="text-decoration: underline;color: blue;cursor: pointer;">{{scope.row.eq_code}}</div>
          </router-link>
        </template>
      </el-table-column>
<!--      <el-table-column prop="eq_no_b" label="机械环保代码" width="150" />-->
      <el-table-column prop="eq_plat_number" label="车牌号" width="150" />
      <el-table-column prop="eq_name" label="农机名称" width="200" />
      <el-table-column prop="eq_module" label="农机型号" width="200" />
      <el-table-column prop="eq_type" label="农机类型" width="100" />
      <el-table-column prop="online_status" label="在线状态" width="100" />
      <el-table-column prop="rcv_time" label="最后定位时间" width="150" />
      <el-table-column prop="interface_type" label="接口类型" width="100" />
      <el-table-column prop="interface_code" label="平台对接码" width="100" />
      <el-table-column prop="engine_pingpai" label="发动机品牌" width="100" />
      <el-table-column prop="engine_no" label="发动机编号" width="100" />

    </el-table>
    <!--分页组件-->
    <pagination />
  </div>
</template>

<script>
import { generator, sync } from '@/api/generator/generator'
import { downloadFile } from '@/utils/index'

import CRUD, { crud, form, header, presenter } from '@crud/V2/crud'
import crudOperation from '@crud/V2/CRUD.operation'
import pagination from '@crud/V2/Pagination'
import rrOperation from '@crud/V2/RR.operation'
import DateRangePicker from '@/components/DateRangePicker'

export default {
  name: 'equipmentDetialInfo',
  components: { pagination, crudOperation, rrOperation,DateRangePicker },
  cruds() {
    return CRUD({ url: 'api/v2/biz/eq' })
  },
  mixins: [presenter(), header()],
  dicts: ['equipment_type', 'eq_interface_type','online_status'],
  dictsV2: ['farms','dealers'],
  data() {
    return {
      syncLoading: false
    }
  },
  created() {
    this.crud.optShow = { add: false, edit: false, del: false, download: false }
  },
  methods: {

  }
}
</script>

<style scoped>

</style>
